//package org.yzh.config;
//
//import com.github.xiaoymin.swaggerbootstrapui.annotations.EnableSwaggerBootstrapUI;
//import io.swagger.annotations.ApiOperation;
//import org.springframework.context.annotation.Bean;
//import org.springframework.context.annotation.Configuration;
//import org.springframework.web.servlet.config.annotation.EnableWebMvc;
//import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
//import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
//import springfox.documentation.builders.ApiInfoBuilder;
//import springfox.documentation.builders.PathSelectors;
//import springfox.documentation.builders.RequestHandlerSelectors;
//import springfox.documentation.service.ApiInfo;
//import springfox.documentation.spi.DocumentationType;
//import springfox.documentation.spring.web.plugins.Docket;
//import springfox.documentation.swagger2.annotations.EnableSwagger2;
//
///**
// * swagger在线文档配置
// * 项目启动后可通过地址：
// * http://host:ip/swagger-ui.html
// * http://host:ip/doc.html
// */
//
////@Profile(value = {"dev","test"})
////@Profile(value = {"test"})
//@Configuration
//@EnableWebMvc
//@EnableSwagger2
//@EnableSwaggerBootstrapUI
//public class Swagger2Configuration implements WebMvcConfigurer {
//    @Bean
//    public Docket createRestApi() {
//
//        return new Docket(DocumentationType.SWAGGER_2)
//                .groupName("mdms")
//                .apiInfo(apiInfo())
//                .select() //ApiOperation Api
////                .apis(RequestHandlerSelectors.basePackage("org.linlinjava.litemall.admin.web"))
//                .apis(RequestHandlerSelectors.withMethodAnnotation(ApiOperation.class))
//                .paths(PathSelectors.any())
//                .build();
//    }
//
//    private ApiInfo apiInfo() {
//        return new ApiInfoBuilder()
//                .title("指令系统api")
//                .description("指令系统接口文档")
////                .termsOfServiceUrl("")
////                .contact("")
//                .version("1.0")
//                .build();
//    }
//
//    @Override
//    public void addResourceHandlers(ResourceHandlerRegistry registry) {
////        registry.addResourceHandler("/**")  // //解决  No mapping for GET /favicon.ico 访问静态资源图标
////                .addResourceLocations("classpath:/static/");
//
//        registry.addResourceHandler("/favicon.ico")
//                .addResourceLocations("classpath:/static/");
//
////        registry.addResourceHandler("/statics/**")
////                .addResourceLocations("classpath:/statics/");
//        // 解决 SWAGGER 404报错
//        registry.addResourceHandler("/swagger-ui.html")
//                .addResourceLocations("classpath:/META-INF/resources/");
//        registry.addResourceHandler("/doc.html")
//                .addResourceLocations("classpath:/META-INF/resources/");
//        registry.addResourceHandler("/webjars/**")
//                .addResourceLocations("classpath:/META-INF/resources/webjars/");
//    }
//}
